Form Parsing

data format accepted by the parseForm function

[
  {
      "key": "body_panel",
      "components": [
          {
              "label": "Юридическое лицо",
              "key": "agreementLegalEntity",
              "properties": {
                  "attribute": "_ECM_contracts:agreementLegalEntity"
              },
              "type": "selectJournal",
              "input": true,
              "value": ""
          },
          ...
      ]
  },
  {
      "key": "footer_panel",
      "components": [
          {
              "type": "columns",
              "columns": [
                  {
                      "components": [
                          {
                              "label": "Rework",
                              "key": "outcome_Rework",
                              "type": "button",
                              "action": "submit"
                          },
                          ...
                      ]
                  },
                  ...
              ]
          },
          {
              "label": "Rework",
              "key": "outcome_Rework",
              "type": "button",
              "action": "submit"
          },
          ...
      ]
  },
  ...
]

Getting elements for display in the properties list:

  • components from the first-level array are filtered by the key "key": "body_panel"

  • iterate through the components array elements, filter them by the "input": true property

  • if "type": "button", the element is selected for passing to the render function, the label attribute is used for localization. Elements with other types are also selected for rendering, with the exception that for localization, the attribute property is used with the ‘_ECM_’ prefix trimmed

  • data is linked to the form by the attribute key

  • the value property is used for display in the interface, formatted as a string or date depending on type

Getting elements for display on the approval panel (buttons):

  • components from the first-level array are filtered by the key "key": "footer_panel"

  • iterate through the columns.components array elements, filter them by the "type": button property. If elements with type columns are encountered, it’s necessary to select the first element of the array in the components property. The label attribute is used for localization

  • the button click handler expects a value from the label property